INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${3RDPARTY_DIR}/include/gdal)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/tinygltf)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/encoder)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/converter)
INCLUDE_DIRECTORIES(${WORKINGPATH}/OpenSceneGraph/include)
INCLUDE_DIRECTORIES(${WORKINGPATH}/OpenSceneGraph/build/include)
LINK_DIRECTORIES(${WORKINGPATH}/OpenSceneGraph/build/lib)

SET(LIB_NAME OCOsg2Cesium)

SET(TARGET_H
    converter/ObliqueConverter.h
    converter/glTFOptimize.h
    converter/ConvertWorkqueue.h
    converter/ObliqueAnalyst.h
    converter/ObliqueTile.h
    converter/ObliqueNodeVisitor.h
    converter/ObliqueNodeInfo.h
    converter/ObliqueConfig.h
    converter/ObliqueNodeInfo.h
    converter/ObliqueUtil.h
    converter/ObliqueTo3DTiles.h
    converter/ObliqueTilingScheme.h
    converter/ObliqueTileStatistic.h
    oe/optional.h
    oe/URI.h
    encoder/Image.hpp
    encoder/KtxOptions.h
    encoder/KtxCompress.h
    tinygltf/tiny_gltf.h
	Osg2CesiumDef.h
	osg.h
    MergeTriangleOperator.h
    gltfConfig.h
    gltfMaterial.h
    DracoEncoder.h
    BatchGeode.h
    gltfHelper.h
    TinyGltfDelegate.h
    WebpEncoder.h
    EdgeGenerator.h
    FeatureAttributeCallback.h
    TextureAtlasBuilder.h
    TextureOptimize.h
    FeatureBatchTable.h
    BatchGroup.h
    gltfObject.h
    TDTiles.h
    B3dmWriter.h
    BaseWriter.h
    I3dmWriter.h
    PntsWriter.h
    X3DM.h
    CmptWriter.h
    CesiumTool.h
)

SET(TARGET_SRC
    converter/ObliqueConverter.cpp
    converter/glTFOptimize.cpp
    converter/ConvertWorkqueue.cpp
    converter/ObliqueAnalyst.cpp
    converter/ObliqueTile.cpp
    converter/ObliqueNodeVisitor.cpp
    converter/ObliqueNodeInfo.cpp
    converter/ObliqueConfig.cpp
    converter/ObliqueUtil.cpp
    converter/ObliqueTo3DTiles.cpp
    converter/ObliqueTilingScheme.cpp
    converter/ObliqueTileStatistic.cpp
    oe/URI.cpp
	encoder/Image.cc
	encoder/KtxCompress.cpp
	src/MergeTriangleOperator.cpp
	src/gltfConfig.cpp
	src/gltfMaterial.cpp
	src/DracoEncoder.cpp
	src/BatchGeode.cpp
	src/gltfHelper.cpp
	src/TinyGltfDelegate.cpp
	src/WebpEncoder.cpp
	src/EdgeGenerator.cpp
	src/TextureAtlasBuilder.cpp
	src/TextureOptimize.cpp
	src/FeatureBatchTable.cpp
    src/BatchGroup.cpp
    src/gltfObject.cpp
    src/TDTiles.cpp
    src/B3dmWriter.cpp
    src/I3dmWriter.cpp
    src/PntsWriter.cpp
    src/X3DM.cpp
    src/CmptWriter.cpp
    src/CesiumTool.cpp
)

SETUP_GROUP()

SET(TARGET_LIBRARIES
    jsoncpp
    OpenThreads
    osg
    osgDB
    osgUtil
    ktx
    draco
    OCMain
    OCesium
    OCGIS
)

SET(TARGET_EXTERNAL_LIBRARIES 
    webp
    gdal
)

ADD_DEFINITIONS(-DTINYGLTF_ENABLE_DRACO -DKHRONOS_STATIC -DTINYGLTF_USE_RAPIDJSON_CRTALLOCATOR)

SETUP_LIBRARY(${LIB_NAME})

ADD_DEPENDENCIES(${LIB_NAME} OCMain)
ADD_DEPENDENCIES(${LIB_NAME} OCesium)
ADD_DEPENDENCIES(${LIB_NAME} OCGIS)

